package com.koicarp.university.graduate.web.controller.information;

import com.koicarp.university.graduate.service.entity.information.InformationType;
import com.koicarp.university.graduate.service.service.information.IInformationTypeService;
import com.koicarp.university.graudate.common.constant.BaseConstant;
import com.koicarp.university.graudate.common.utils.UniversityResponse;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 【资讯管理：资讯类别表】(InformationType)表控制层
 *
 * @author liutao
 * @since 2020-09-03 19:49:46
 */
@Slf4j
@RestController
@RequestMapping("informationType")
@RequiredArgsConstructor
public class InformationTypeController {
    /**
     * 服务对象
     */
    private final IInformationTypeService informationTypeService;

    @PostMapping("getAllType")
    @ApiOperation(value = "查询所有学院信息",notes = "查询所有学院信息")
    public UniversityResponse getAllType(){
        UniversityResponse response=null;
        try{
            response = informationTypeService.getAllType();
        }catch (Exception e){
            log.error("查询失败",e);
            response = new UniversityResponse();
            response.code(BaseConstant.RESPONSE_CODE_FAILED_500);
            response.message(BaseConstant.RESPONSE_MESSAGE_OPR_FAILED);
        }
        return response;
    }

}